/*
 * Scheduler.h
 *
 *  Created on: 24.09.2012
 *      Author: Lapchinskiy
 */
#include "BuildConfig.h"
#include "Global_types.h"
#include "ArrayList.h"
#include "Condition.h"
#include "Task.h"
#ifndef SCHEDULER_H_
#define SCHEDULER_H_
//#define MAX_EVENT_NUMBER  (uint8_t) 4
class Scheduler {
private:
	Scheduler();
	~Scheduler();
	volatile static uint32_t eventMask;
	//static ArrayList<Sensor> taskList;
	static ArrayList<Task> *taskLists;
	static bool schedEnable;
public:
	//Condition<int> sens;
	static ErrorCode init(void);
	static ErrorCode start(void);
	static ErrorCode stop(void);
	static ErrorCode addTask(Task *taskToAdd, EventType eventToListen);
	static ErrorCode sendEvent(uint8_t event);
	static ErrorCode waitForEvent(void);
	static ErrorCode waitForEvent(uint16_t timeout);
	static ErrorCode kickTheDog(void);
	static ArrayList<Task>* getTaskLists();

};

#endif /* SCHEDULER_H_ */
